package com.bwie.system.controller;

import java.util.Arrays;
import java.util.Map;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.bwie.system.entity.XtmessageEntity;
import com.bwie.system.service.XtmessageService;
import com.bwie.common.utils.PageUtils;
import com.bwie.common.utils.R;



/**
 * 
 *
 * @author wangguohai
 * @email 270901876@qq.com
 * @date 2022-05-02 15:51:59
 */
@RestController
@RequestMapping("system/xtmessage")
public class XtmessageController {
    @Autowired
    private XtmessageService xtmessageService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = xtmessageService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{xtId}")
    public R info(@PathVariable("xtId") Integer xtId){
		XtmessageEntity xtmessage = xtmessageService.getById(xtId);

        return R.ok().put("xtmessage", xtmessage);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody XtmessageEntity xtmessage){
		xtmessageService.save(xtmessage);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody XtmessageEntity xtmessage){
		xtmessageService.updateById(xtmessage);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] xtIds){
		xtmessageService.removeByIds(Arrays.asList(xtIds));

        return R.ok();
    }

}
